<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>props + data </title>
    <script src="../../vue.js"></script>
</head>
<body>
<div id="box">
    <hao id="first" name = 'zhagnhao' age = '18'></hao>
</div>
<script type="x-template" id="tp1">
    <h1>{{name}}</h1>
    <h4>{{age}}</h4>
    <h4>{{sex}}</h4>
</script>
<script>
    var vm1 = Vue.component('hao', {
        props:['name','age'],
        data:function () {
            return {'sex':'男'}
        },
        template : '#tp1'
    })
    var vm = new Vue({
        el:'#box',
    })
</script>
</body>
</html>